using Gateway.Common.Entity;
using Gateway.Common.Enums;

namespace Gateway.Domain.Entities;

/// <summary>
/// 流程设计
/// </summary>
public class WorkFlowDesign : AggregateRootEntityBase
{
    public WorkFlowDesign(string nodeName = default, int type = default, WorkFlowDesignPromoter promoter = default,
        WorkFlowDesignBranch branch = default, WorkFlowDesignApprove approve = default,
        WorkFlowDesignSend send = default, string parentId = default)
    {
        NodeName = nodeName;
        Type = type;
        Promoter = promoter;
        Branch = branch;
        Approve = approve;
        Send = send;
        ParentId = parentId;
    }

    public void Update(string nodeName = default, int type = default, WorkFlowDesignPromoter promoter = default,
        WorkFlowDesignBranch branch = default, WorkFlowDesignApprove approve = default,
        WorkFlowDesignSend send = default)
    {
        NodeName = nodeName;
        Type = type;
        Promoter = promoter;
        Branch = branch;
        Approve = approve;
        Send = send;
    }

    /// <summary>
    /// 节点名称
    /// </summary>
    public string NodeName { get; set; }

    /// <summary>
    /// 节点类型  0 发起人   1 审批人  2 抄送人  4 条件分支
    /// </summary>
    public int Type { get; set; }

    /// <summary>
    /// 发起人 配置
    /// </summary>
    public WorkFlowDesignPromoter Promoter { get; set; }

    /// <summary>
    /// 分支 配置
    /// </summary>
    public WorkFlowDesignBranch Branch { get; set; }

    /// <summary>
    /// 审批者 配置
    /// </summary>
    public WorkFlowDesignApprove Approve { get; set; }

    /// <summary>
    /// 抄送 配置
    /// </summary>
    public WorkFlowDesignSend Send { get; set; }

    /// <summary>
    /// 父级标识
    /// </summary>
    public string ParentId { get; set; }

    public WorkFlowDesign()
    {
    }
}